package org.grayrabbit.cms.entity;

// Generated 2011-5-16 13:39:30 by Hibernate Tools 3.3.0.GA

import java.util.HashSet;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;

/**
 * CmsVoteOption generated by hbm2java
 */
@Entity
@Table(name = "CMS_VOTE_OPTION")
public class VoteOption implements java.io.Serializable {

	private static final long serialVersionUID = 2374018848767715613L;
	private String voteOptionId;
	private Vote vote;
	private String voteOptionTitle;
	private String memo;
	private Integer resultCount;
	private Integer ord;
	private Set<VoteRecord> voteRecords = new HashSet<VoteRecord>(0);

	public VoteOption() {
	}

	public VoteOption(String voteOptionId) {
		this.voteOptionId = voteOptionId;
	}

	@Id
	@Column(name = "VOTE_OPTION_ID", unique = true, nullable = false, length = 32)
	@GeneratedValue(generator = "paymentableGenerator")       
	@GenericGenerator(name = "paymentableGenerator", strategy = "uuid") 
	public String getVoteOptionId() {
		return this.voteOptionId;
	}

	public void setVoteOptionId(String voteOptionId) {
		this.voteOptionId = voteOptionId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "VOTE_ID")
	public Vote getVote() {
		return vote;
	}

	public void setVote(Vote vote) {
		this.vote = vote;
	}
	
	@Column(name = "VOTE_OPTION_TITLE", length = 32)
	public String getVoteOptionTitle() {
		return this.voteOptionTitle;
	}

	public void setVoteOptionTitle(String voteOptionTitle) {
		this.voteOptionTitle = voteOptionTitle;
	}

	@Column(name = "MEMO", length = 256)
	public String getMemo() {
		return this.memo;
	}

	public void setMemo(String memo) {
		this.memo = memo;
	}

	@Column(name = "RESULT_COUNT", precision = 6, scale = 0)
	public Integer getResultCount() {
		return this.resultCount;
	}

	public void setResultCount(Integer resultCount) {
		this.resultCount = resultCount;
	}

	@Column(name = "ORD", precision = 6, scale = 0)
	public Integer getOrd() {
		return this.ord;
	}

	public void setOrd(Integer ord) {
		this.ord = ord;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "voteOption")
	public Set<VoteRecord> getVoteRecords() {
		return voteRecords;
	}

	public void setVoteRecords(Set<VoteRecord> voteRecords) {
		this.voteRecords = voteRecords;
	}

}
